layui.use(['layer','form','table','element','layedit','upload'],function () {
    var layer = layui.layer
        ,form = layui.form
        ,table =layui.table
        ,element = layui.element
        ,layedit = layui.layedit
        ,upload = layui.upload;

        //提交表单
    form.on('submit(form)',function (data) {

        var paramData = {
            "id":$("#id").val(),
            "siteName":$("#siteName").val(),
            "siteUrl":$("#siteUrl").val(),
            "articleelecssquery":$("#articleelecssquery").val(),
            "todayformat":$("#todayformat").val(),
            "datecssquery":$("#datecssquery").val(),
            "titlecssquery":$("#titlecssquery").val(),
            "urlcssquery":$("#urlcssquery").val(),
            "desccssquery":$("#desccssquery").val(),
            "descexcludecssquery":$("#descexcludecssquery").val(),
            "descurlpre":$("#descurlpre").val(),
            "dateignore":$("#dateignore").val(),
            "autoSave":$("#autoSave").val(),
            "isMachine":$("#isMachine").val()
        };

        var data2 = JSON.stringify(paramData);

        //保存项目
        $.ajax({
            url:"/admin/spider/siteUpdate",
            type:"POST",
            data:data2,
            // dataType:"json",
            contentType:"application/json;charset=utf-8",
            success:function (result) {
                // console.log("data=="+form_data)
                if(result.flag){
                    layer.msg(result.message);
                    //清空内容
                    // $("#form").reset();
                    document.getElementById("form").reset();
                    layui.form.render();
                }else{
                    layer.msg(result.message);
                }
            },
            error:function () {
                layer.msg("系统错误！");
            }
        });

    });
});
